package seconddemo;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class Input {
	public static void main(String[] args) {
		File fs = new File("d:\\abc.txt");
		try {
			FileInputStream fis = new FileInputStream(fs);
			byte[] bt = new byte[(int) fs.length()];
			try {
				fis.read(bt);
				fis.close();
				for (byte f : bt) {
					System.out.println((char) f);
				}
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		/*
		 * int a; try { FileInputStream fis=new FileInputStream(fs); try {
		 * a=fis.read(); while(a!=-1) { System.out.println((char)a);
		 * a=fis.read(); } } catch (IOException e) {
		 * System.out.println("读取失败！！！"); } } catch (FileNotFoundException e) {
		 * System.out.println("读取失败！！！"); }
		 */
	}
}
